<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../../js/boot.js"></script>
    <style>
    </style>
</head>

<body>
    <div id="container">
        <div id="formcontainer">
            <form class="layui-form layui-form-pane" id="editform" lay-filter="editform">
                <div class="layui-row">
                    <div class="layui-col-xs6">
                        <div class="layui-form-item">
                            <label class="layui-form-label required">账户名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="account_name" autocomplete="off" class="layui-input required">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-form-item" pane="">
                            <label class="layui-form-label required">账户编号</label>
                            <div class="layui-input-block">
                                <input type="text" name="account_no" autocomplete="off" class="layui-input required">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-xs6">
                        <div class="layui-form-item" pane="">
                            <label class="layui-form-label required">账户类型</label>
                            <div class="layui-input-block">
                                <input type="text" name="account_type" autocomplete="off" class="layui-input required">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-form-item" pane="">
                            <label class="layui-form-label">vip</label>
                            <div class="layui-input-block">
                                <input type="text" name="account_vip" autocomplete="off" class="layui-input required">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-xs6">
                        <div class="layui-form-item">
                            <label class="layui-form-label">账户限额</label>
                            <div class="layui-input-block">
                                <input type="text" name="account_limit" autocomplete="off" class="layui-input number required" value="0">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-form-item">
                            <label class="layui-form-label required">开户日期</label>
                            <div class="layui-input-block">
                                <input type="text" name="open_date" autocomplete="off" class="layui-input layui-date required">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-xs12">
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">账户条款</label>
                            <div class="layui-input-block">
                                <textarea type="text" name="account_rules" autocomplete="off" class="layui-textarea"></textarea>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-xs6">
                        <div class="layui-form-item" pane="">
                            <label class="layui-form-label required">账户状态</label>
                            <div class="layui-input-block">
                                <input type="text" name="account_status" autocomplete="off" class="layui-input required">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-xs6">
                        <div class="layui-form-item">
                            <label class="layui-form-label">排序</label>
                            <div class="layui-input-block">
                                <input type="text" name="sort_num" autocomplete="off" class="layui-input number" value="0">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-xs12">
                        <div class="layui-form-item  layui-form-text">
                            <label class="layui-form-label">开户证明</label>
                            <div class="layui-input-block">
                                <boot-upload id="kaihuattach"  grouptype="kaihuattach"></boot-upload>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-xs12">
                        <div class="layui-form-item  layui-form-text">
                            <label class="layui-form-label">流水材料</label>
                            <div class="layui-input-block">
                                <boot-upload id="liushuiattach"  grouptype="liushuiattach"></boot-upload>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
        <div id="opcontainer">
            <button class="layui-btn" onclick="HandleSave()">确认</button>
            <button class="layui-btn layui-btn-primary" onclick="HandleClose()">关闭</button>
        </div>
    </div>
</body>
<script>
    var row_id = GetNewGuid();
    $(function() {
        BindRadio("account_type", "账户类型", 10);
        BindRadio("account_vip", "是否", 20);
        BindRadio("account_status", "启用禁用", 10);
        BindAttach(row_id);
    })

    function HandleSave() {
        SubmitForm('editform', 'system/codegen/example/insert', BeforeSubmit, null, function(result, status) {
            if (result.code == 0) {
                OpenSuccess('添加成功', function(params) {
                    CloseDialog();
                })
            } else {
                OpenFail(result.msg);
            }
        })
    }

    function BeforeSubmit(data) {
        data.row_id = row_id;
        return true;
    }

    function HandleClose() {
        CloseDialog();
    }
</script>

</html>